#pragma once

#include <grpc/grpc.h>
#include <grpcpp/create_channel.h>
#include <grpcpp/grpcpp.h>

#include "monitor_info.grpc.pb.h"
#include "monitor_info.pb.h"

namespace monitor
{
    class RpcClient
    {
    public:
        // 连接被监视机器上的grpc服务
        RpcClient(const std::string &server_address = "localhost:50051");
        ~RpcClient();
        void SetMonitorInfo(const monitor::proto::MonitorInfo &monito_info);
        void GetMonitorInfo(const monitor::proto::GetRequest &get_request, monitor::proto::MonitorInfo *monito_info);

    private:
        std::unique_ptr<monitor::proto::GrpcManager::Stub> stub_ptr_;
    };
} // namespace monitor
